<?php
/**
 * Created by PhpStorm.
 * User: longyu
 * Date: 2016/6/2
 * Time: 10:15
 */
require "redis.php";
$username=$_POST["username"];
$password=$_POST["password"];
$age=$_POST["age"];
$uid=$redis->incr("userid");
$redis->hMset("user:{$uid}",array("uid"=>$uid,"username"=>$username,"password"=>md5($password) ,"age"=>$age));
$redis->rPush("uid",$uid);
$redis->set("username:".$username,$uid);
header("Location:list.php");